package com.lancer.cloud.gateway.refresh;

import com.baomidou.mybatisplus.extension.api.R;
import com.lancer.cloud.gateway.event.RefreshRouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 刷新zuul路由
 *
 * @author caijinbang
 * @date 2019-06-16 14:11
 */
@RestController
public class RefreshRouteController {


    @Autowired
    private RefreshRouteService refreshRouteService;

    @GetMapping("/refresh")
    public R refresh() {
        refreshRouteService.refreshRoute();
        return R.ok("success");
    }
}
